]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overview: make dash private
authorRay Strode <rstrode@redhat.com>
Sun, 28 Aug 2011 13:35:13 +0000 (09:35 -0400)
committerRay Strode <rstrode@redhat.com>
Sun, 28 Aug 2011 16:25:04 +0000 (12:25 -0400)
The dash object is currently exposed as a public object.
It's only used outside of the overview for the dash object's
iconSize property though.

This commit makes the dash object private and proxies the dash
iconSize property to the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=657082

js/ui/appDisplay.js
js/ui/dash.js
js/ui/overview.js
js/ui/searchDisplay.js

index acaa77526fe1472382beb4f35377c5141850e11c..1a6e28aef902e20fe629630720a9de2890e93052 100644 (file)
@@ -608,7 +608,7 @@ AppWellIcon.prototype = {
     },
 
     getDragActor: function() {
-        return this.app.create_icon_texture(Main.overview.dash.iconSize);
+        return this.app.create_icon_texture(Main.overview.dashIconSize);
     },
 
     // Returns the original actor that should align with the actor
index f2c652c61e9f7184c1583fed941ebbc7e7ac7e73..77d4eb4a02654a0dff0149b8d43890b9f7c4f68b 100644 (file)
@@ -437,6 +437,7 @@ Dash.prototype = {
 
         let oldIconSize = this.iconSize;
         this.iconSize = newIconSize;
+        this.emit('icon-size-changed');
 
         let scale = oldIconSize / newIconSize;
         for (let i = 0; i < iconChildren.length; i++) {
index 4f3d1025a2c6c32b2d4b925b39379112f3339b25..4cba62a10c4c807a139be6f87647bd24533b1e1e 100644 (file)
@@ -193,14 +193,19 @@ Overview.prototype = {
         this._viewSelector.addSearchProvider(new DocDisplay.DocSearchProvider());
 
         // TODO - recalculate everything when desktop size changes
-        this.dash = new Dash.Dash();
-        this._group.add_actor(this.dash.actor);
-        this.dash.actor.add_constraint(this._viewSelector.constrainY);
-        this.dash.actor.add_constraint(this._viewSelector.constrainHeight);
+        this._dash = new Dash.Dash();
+        this._group.add_actor(this._dash.actor);
+        this._dash.actor.add_constraint(this._viewSelector.constrainY);
+        this._dash.actor.add_constraint(this._viewSelector.constrainHeight);
+        this.dashIconSize = this._dash.iconSize;
+        this._dash.connect('icon-size-changed',
+                           Lang.bind(this, function() {
+                               this.dashIconSize = this._dash.iconSize;
+                           }));
 
         // Translators: this is the name of the dock/favorites area on
         // the left of the overview
-        Main.ctrlAltTabManager.addGroup(this.dash.actor, _("Dash"), 'user-bookmarks');
+        Main.ctrlAltTabManager.addGroup(this._dash.actor, _("Dash"), 'user-bookmarks');
 
         Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._relayout));
         this._relayout();
@@ -467,12 +472,12 @@ Overview.prototype = {
         // Set the dash's x position - y is handled by a constraint
         let dashX;
         if (rtl) {
-            this.dash.actor.set_anchor_point_from_gravity(Clutter.Gravity.NORTH_EAST);
+            this._dash.actor.set_anchor_point_from_gravity(Clutter.Gravity.NORTH_EAST);
             dashX = primary.width;
         } else {
             dashX = 0;
         }
-        this.dash.actor.set_x(dashX);
+        this._dash.actor.set_x(dashX);
 
         this._viewSelector.actor.set_position(viewX, viewY);
         this._viewSelector.actor.set_size(viewWidth, viewHeight);
index bdaa59c8d42fc32f0a2c1499bf1c0eb85245870f..d1534afb1dda972c8d17d28fc791b7bfa14b3d49 100644 (file)
@@ -88,7 +88,7 @@ SearchResult.prototype = {
     },
 
     getDragActor: function(stageX, stageY) {
-        return this.metaInfo['createIcon'](Main.overview.dash.iconSize);
+        return this.metaInfo['createIcon'](Main.overview.dashIconSize);
     },
 
     shellWorkspaceLaunch: function(params) {